<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .aa{
          width: 300px;
          height: 300px;
          line-height: 300px;
          background: pink;
          color: #fff;
          text-align:center;
          font-size: 32px;
          margin-top: 10px;
        }
    </style>
</head>
<body>
    <div id="pg">
        <button  v-for='(item,index) in title'
        @click='bian(index)'>{{ item.item }}</button>

        <div v-for='(item,index) in contents' 
        :class='{aa:pp}'
        v-show='index==num'>{{ item.item }}</div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
      <script>
        var pg = new Vue({
              //绑定元素,挂载的页面节点
            el: '#pg',
            // 实例可用数据
            data: {
                pp:true,
                title: [{
                        item: 'html'
                    },
                    {
                        item: 'css'
                    },
                    {
                        item: 'js'
                    },
                    {
                        item: 'vuejs'
                    },
                ],
                contents: [{
                        item: 'html-contents'
                    },
                    {
                        item: 'css-contents'
                    },
                    {
                        item: 'js-contents'
                    },
                    {
                        item: 'vuejs-contents'
                    }
                ],
                num:0,
                show: true
            },
            methods:{   
            bian(key){
               this.num = key;
           }
            }
        })

      </script>
</body>
</html>